package thesis.database;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;


public class RouteMapper implements RowMapper<Route> {

	@Override
	public Route mapRow(ResultSet rs, int rowNum) throws SQLException {
		Route route = new Route();
		route.setGpsData(rs.getString("gps_data"));
		route.setId(rs.getInt("id"));
		route.setLatitude(rs.getString("latitude"));
		route.setLongitude(rs.getString("longitude"));
		route.setSpeed(rs.getDouble("speed"));
		route.setStatus(rs.getInt("status"));
		route.setTaxiId(rs.getInt("taxi_id"));
		route.setTime(rs.getTimestamp("time"));
		return route;
	}

}
